/* Include these
   #include <nit/list.h>
*/

typedef struct {
	Nit_dlist list;
	void *here;
} Inb_cell;

typedef struct {
	Inb_des des;
	Inb_cell cell;
} Inb_cell_tagd;

Inb_cell *
inb_cell_new(void *prev, void *next, void *here);

void *
inb_car(void *dat);

void *
inb_cdr(void *dat);

void *
inb_rcdr(void *dat);

void
inb_app(Inb_cell *cell, void *next);

void
inb_prep(Inb_cell *cell, void *prev);

static inline Inb_cell *
inb_cons(void *car, void *cdr)
{
	return inb_cell_new(NULL, cdr, car);
}

static inline Inb_cell *
inb_rcons(void *car, void *rcdr)
{
	return inb_cell_new(rcdr, NULL, car);
}

static inline Inb_cell *
inb_nest(void *car)
{
	return inb_cons(car, NULL);
}

Inb_cell *
inb_cell_va(size_t size, ...);
